from constants import *
import PIL
import os
from PIL import Image

move_from = ["Images - Discarded","Images - For manual verification"]
move_to = "Images - Analysis"
remove_files = [r"Data\paths\norm_average"]
clean_dirs = [r"Data\paths\normalized",r"Data\paths\standard",r"Data\weights"]


def clean_dir(folder):
    for the_file in os.listdir(folder):
        file_path = os.path.join(folder, the_file)
        try:
            if os.path.isfile(file_path):
                os.unlink(file_path)
        except Exception, e:
            print e


for d in move_from:
    for n in os.listdir(d):
        os.rename(os.path.join(d,n),os.path.join(move_to,n))

for folder in clean_dirs:
    clean_dir(folder)

print "done"
